package _03异常的处理trycatch;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DemoTryCatch {
    public static void main(String[] args) {
        SimpleDateFormat sdf = new SimpleDateFormat();
        try {
            Date date = sdf.parse("2009-10-1");
            System.out.println("try此段代码被执行了");//不会被执行

        } catch (ParseException e) {
            System.out.println("格式不匹配");
            System.out.println("catch此段代码被执行了");
        }

        System.out.println("111");

    }
}
